package com.itheima.reggie.commen;

public class BaseContext {
    private static ThreadLocal<Long> threadLocal= new ThreadLocal<>();

    //在当前请求线程里面保存当前登录用户的id
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    //获取保存的用户id
    public static Long getCurrentId(){
        return threadLocal.get();
    }
}
